Page({
  data: {
    width: 94,          //3d画布宽
    height: 130,         //3d画布高
    renderWidth: 940,   //画布像素宽
    renderHeight: 1300,  //画布像素高
    target:"wall",      //初始摄像头对准的对象
    position:"0 1 0.5", //初始摄像头位置
    picUrl:(getApp()).globalData.hostAddress+"/gallaryMarket/img/goods/980000/1733044688-smallPic.jpg",//默认是主页大图
    positionIndex:0     //摄像头位置索引
  },
  //changeTarget 转换下一个场景响应函数
  changeTarget(){
    this.setData({
      positionIndex:this.data.positionIndex+1<=1?this.data.positionIndex+1:-1
    });
    let target = "";
    switch(this.data.positionIndex){
      case 0:
        target = "wall";      //场景1
        break;
      case 1:
        target = "drawing2";  //场景2
        break;
      case -1:
        target = "drawing3";  //场景3
        break;
      default:
        break;
    }
    this.setData({
      target:target,
      position:this.data.positionIndex*2+" 1 0.5"
      // target:"drawing3",
      // position:"-2 1 0.5"
      // target:"drawing2",
      // position:"2 1 0.5"
      // target:"drawing1",
      // position:"0 1 0.5"
    })
  },
  onLoad(options) {
    (getApp()).isLogined();//检查是否登录
    this.setData({themeIndex:(getApp()).globalData.themeIndex});//设置主题
  }
})